<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Item Specification</title>

<!-- JQuery for JConfirmation -->	
<script type="text/javascript" src="<c:url value="/resources/script/jquery/jconfirmaction.jquery.js"/>"></script>
<script type="text/javascript">	
	$(document).ready(function() {
		$('.ask').jConfirmAction();
	});	
</script>
<script language="JavaScript">
	function toggle(source) {
	  checkboxes = document.getElementsByName('foo');
	  for(var i in checkboxes)
	    checkboxes[i].checked = source.checked;
	}
</script>
</head>
<body>
	<div>
	<form id="form" action="<c:url value="#"/>" method="post">
		<div>
			<table>
				<tr>
					<th align="left"><h2>List of Item</h2>
					</th>
					<th><a
						href="<c:url value="/item/specification/insertitemspec"/>"
						class="bt_green"><span class="bt_green_lft"></span><strong>Add
								new item</strong><span class="bt_green_r"></span>
					</a>
					<a
						href="<c:url value="/item/specification/restoreItemSpec"/>"
						class="bt_green"><span class="bt_green_lft"></span><strong>
								Deleted Item</strong><span class="bt_green_r"></span>
					</a>
					</th>
				</tr>
				<tr>
					<td colspan="2">

						<table id="rounded-corner"
							summary="2007 Major IT Companies' Profit">
							<thead>
								<tr>
									<th scope="col" class="rounded-company"><input type="checkbox" onClick="toggle(this)" /></th>
									<th scope="col" class="rounded"><b>Code</b>
									</th>
									<th scope="col" class="rounded"><b>Category</b>
									</th>
									<th scope="col" class="rounded"><b>Condition</b>
									</th>
									<th scope="col" class="rounded"><b>Quantity</b>
									</th>
									<th scope="col" class="rounded"><b>Brand</b>
									</th>
									<th scope="col" class="rounded"><b>Type</b>
									</th>
									<th scope="col" class="rounded"><b>Edit</b>
									</th>
									<th scope="col" class="rounded-q4"><b>Delete</b>
									</th>
								</tr>
							</thead>
							<tbody>
								<c:forEach var="listitem" items="${listitem}" varStatus="status">
									<tr>
										<td><input type="checkbox" name="foo" value="${listitem.id}"/>
										</td>
										<td>${listitem.code}</td>
										<td>${listitem.category.categoryName}</td>
										<td>${listitem.condition}</td>
										<td>${listitem.qty}</td>
										<td>${listitem.brand.brandName}</td>
										<td>${listitem.type.itemType}</td>
										<td><a class="view"
											href="<c:url value="/item/specification/detailitemspec?id=${listitem.id}"/>"
											class="editItem"><img
												src="<c:url value="/resources/images/images/user_edit.png"/>"
												alt="" title="" border="0" />
										</a>
										</td>
										<td><a class="ask"
											href="<c:url value="/item/specification/deleteitemspec?id=${listitem.id}"/>"><img
												src="<c:url value="/resources/images/images/trash.png"/>"
												alt="" title="" border="0" />
										</a>
										</td>
									</tr>
								</c:forEach>
							</tbody>
							<tfoot>
								<tr>
									<td colspan="8" class="rounded-foot-left"><em>@Xsis
											Mitra Utama</em>
									</td>
									<td class="rounded-foot-right">&nbsp;</td>

								</tr>
							</tfoot>
						</table></td>
				</tr>
			</table>
		</div>
	</form>
	</div>
	<div>
		<p><font color="blue">Import data from Excel file:</font></p>
		<form action="upload" method="post" enctype="multipart/form-data"
			onSubmit="if(document.getElementById('fileinput').value == ''){alert('Choose file!'); return false;} ">
			<input size="70" type="file" name="spreadsheet" id="fileinput" /> 
			<input type="submit" value="Upload File" />
		</form>
	</div>
</body>
</html>